package com.kanesoft.android.gdx.backgrounds;

import com.kanesoft.android.gdx.widgets.sprites.SpriteInfo;
import com.kanesoft.android.gdx.widgets.sprites.SpriteSlideInfo;
import com.kanesoft.android.gdx.widgets.sprites.SpriteWidget;

public class Background {
    
    private SpriteWidget sprite;
    private SpriteInfo info;
    private float incX, incY;
    
    public Background(String fileName, float x, float y, int width, int height,float scaleX, float scaleY, float camIncrementFactorX, float camIncrementFactorY ) {
        incX = camIncrementFactorX;
        incY = camIncrementFactorY;
        info = new SpriteInfo(fileName, 0);
        info.addSpriteSlide(new SpriteSlideInfo(0, 0, width, height));
        sprite = new SpriteWidget(x, y, scaleX, scaleY, info, null);
        sprite.enabled = false;
    }
    
    public void drawBackground(float delay, float camOffsetX, float camOffsetY) {
        sprite.enabled = true;
        sprite.draw(delay, camOffsetX*incX, camOffsetY*incY);
    }
    
    
}
